Optimal. Leaf size=131 \[ -\frac {d-e+f-g+h}{6 (1+x)}-\frac {d-2 e+4 f-8 g+16 h}{12 (2+x)}-\frac {1}{36} (d+e+f+g+h) \log (1-x)+\frac {1}{144} (d+2 e+4 f+8 g+16 h) \log (2-x)-\frac {1}{36} (7 d-13 e+19 f-25 g+31 h) \log (1+x)+\frac {1}{144} (31 d-50 e+76 f-104 g+112 h) \log (2+x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.18, antiderivative size = 131, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {1600, 6860}
\begin {gather*} -\frac {d-e+f-g+h}{6 (x+1)}-\frac {d-2 e+4 f-8 g+16 h}{12 (x+2)}-\frac {1}{36} \log (1-x) (d+e+f+g+h)+\frac {1}{144} \log (2-x) (d+2 e+4 f+8 g+16 h)-\frac {1}{36} \log (x+1) (7 d-13 e+19 f-25 g+31 h)+\frac {1}{144} \log (x+2) (31 d-50 e+76 f-104 g+112 h) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 1600
Rule 6860
Rubi steps
\begin {align*} \int \frac {\left (2-3 x+x^2\right ) \left (d+e x+f x^2+g x^3+h x^4\right )}{\left (4-5 x^2+x^4\right )^2} \, dx &=\int \frac {d+e x+f x^2+g x^3+h x^4}{\left (2-3 x+x^2\right ) \left (2+3 x+x^2\right )^2} \, dx\\ &=\int \left (\frac {d+2 e+4 f+8 g+16 h}{144 (-2+x)}+\frac {-d-e-f-g-h}{36 (-1+x)}+\frac {d-e+f-g+h}{6 (1+x)^2}+\frac {-7 d+13 e-19 f+25 g-31 h}{36 (1+x)}+\frac {d-2 e+4 f-8 g+16 h}{12 (2+x)^2}+\frac {31 d-50 e+76 f-104 g+112 h}{144 (2+x)}\right ) \, dx\\ &=-\frac {d-e+f-g+h}{6 (1+x)}-\frac {d-2 e+4 f-8 g+16 h}{12 (2+x)}-\frac {1}{36} (d+e+f+g+h) \log (1-x)+\frac {1}{144} (d+2 e+4 f+8 g+16 h) \log (2-x)-\frac {1}{36} (7 d-13 e+19 f-25 g+31 h) \log (1+x)+\frac {1}{144} (31 d-50 e+76 f-104 g+112 h) \log (2+x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 136, normalized size = 1.04 \begin {gather*} \frac {1}{144} \left (-\frac {12 (d (5+3 x)+2 (4 f-6 g+10 h+3 f x-5 g x+9 h x-e (3+2 x)))}{2+3 x+x^2}-4 (d+e+f+g+h) \log (1-x)+(d+2 (e+2 f+4 g+8 h)) \log (2-x)-4 (7 d-13 e+19 f-25 g+31 h) \log (1+x)+(31 d-50 e+76 f-104 g+112 h) \log (2+x)\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.06, size = 132, normalized size = 1.01
method | result | size |
default | \(-\frac {\frac {d}{12}-\frac {e}{6}+\frac {f}{3}-\frac {2 g}{3}+\frac {4 h}{3}}{x +2}+\left (\frac {31 d}{144}-\frac {25 e}{72}+\frac {19 f}{36}-\frac {13 g}{18}+\frac {7 h}{9}\right ) \ln \left (x +2\right )+\left (\frac {d}{144}+\frac {e}{72}+\frac {f}{36}+\frac {g}{18}+\frac {h}{9}\right ) \ln \left (x -2\right )+\left (-\frac {d}{36}-\frac {e}{36}-\frac {f}{36}-\frac {g}{36}-\frac {h}{36}\right ) \ln \left (-1+x \right )+\left (-\frac {7 d}{36}+\frac {13 e}{36}-\frac {19 f}{36}+\frac {25 g}{36}-\frac {31 h}{36}\right ) \ln \left (1+x \right )-\frac {\frac {d}{6}-\frac {e}{6}+\frac {f}{6}-\frac {g}{6}+\frac {h}{6}}{1+x}\) | \(132\) |
norman | \(\frac {\left (-\frac {d}{4}+\frac {e}{3}-\frac {f}{2}+\frac {5 g}{6}-\frac {3 h}{2}\right ) x^{3}+\left (\frac {3 d}{4}-\frac {5 e}{6}+f -\frac {4 g}{3}+2 h \right ) x +\left (\frac {d}{3}-\frac {e}{2}+\frac {5 f}{6}-\frac {3 g}{2}+\frac {17 h}{6}\right ) x^{2}-\frac {5 d}{6}+e +2 g -\frac {10 h}{3}-\frac {4 f}{3}}{x^{4}-5 x^{2}+4}+\left (-\frac {7 d}{36}+\frac {13 e}{36}-\frac {19 f}{36}+\frac {25 g}{36}-\frac {31 h}{36}\right ) \ln \left (1+x \right )+\left (-\frac {d}{36}-\frac {e}{36}-\frac {f}{36}-\frac {g}{36}-\frac {h}{36}\right ) \ln \left (-1+x \right )+\left (\frac {d}{144}+\frac {e}{72}+\frac {f}{36}+\frac {g}{18}+\frac {h}{9}\right ) \ln \left (x -2\right )+\left (\frac {31 d}{144}-\frac {25 e}{72}+\frac {19 f}{36}-\frac {13 g}{18}+\frac {7 h}{9}\right ) \ln \left (x +2\right )\) | \(169\) |
risch | \(\frac {\left (-\frac {d}{4}+\frac {e}{3}-\frac {f}{2}+\frac {5 g}{6}-\frac {3 h}{2}\right ) x -\frac {5 d}{12}+\frac {e}{2}-\frac {2 f}{3}+g -\frac {5 h}{3}}{x^{2}+3 x +2}-\frac {\ln \left (-1+x \right ) d}{36}-\frac {\ln \left (-1+x \right ) e}{36}-\frac {\ln \left (-1+x \right ) f}{36}-\frac {\ln \left (-1+x \right ) g}{36}-\frac {\ln \left (-1+x \right ) h}{36}+\frac {\ln \left (2-x \right ) d}{144}+\frac {\ln \left (2-x \right ) e}{72}+\frac {\ln \left (2-x \right ) f}{36}+\frac {\ln \left (2-x \right ) g}{18}+\frac {\ln \left (2-x \right ) h}{9}-\frac {7 \ln \left (-1-x \right ) d}{36}+\frac {13 \ln \left (-1-x \right ) e}{36}-\frac {19 \ln \left (-1-x \right ) f}{36}+\frac {25 \ln \left (-1-x \right ) g}{36}-\frac {31 \ln \left (-1-x \right ) h}{36}+\frac {31 \ln \left (x +2\right ) d}{144}-\frac {25 \ln \left (x +2\right ) e}{72}+\frac {19 \ln \left (x +2\right ) f}{36}-\frac {13 \ln \left (x +2\right ) g}{18}+\frac {7 \ln \left (x +2\right ) h}{9}\) | \(205\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 129, normalized size = 0.98 \begin {gather*} \frac {1}{144} \, {\left (31 \, d + 76 \, f - 104 \, g + 112 \, h - 50 \, e\right )} \log \left (x + 2\right ) - \frac {1}{36} \, {\left (7 \, d + 19 \, f - 25 \, g + 31 \, h - 13 \, e\right )} \log \left (x + 1\right ) - \frac {1}{36} \, {\left (d + f + g + h + e\right )} \log \left (x - 1\right ) + \frac {1}{144} \, {\left (d + 4 \, f + 8 \, g + 16 \, h + 2 \, e\right )} \log \left (x - 2\right ) - \frac {{\left (3 \, d + 6 \, f - 10 \, g + 18 \, h - 4 \, e\right )} x + 5 \, d + 8 \, f - 12 \, g + 20 \, h - 6 \, e}{12 \, {\left (x^{2} + 3 \, x + 2\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 267 vs.
\(2 (119) = 238\).
time = 5.11, size = 267, normalized size = 2.04 \begin {gather*} -\frac {12 \, {\left (3 \, d - 4 \, e + 6 \, f - 10 \, g + 18 \, h\right )} x - {\left ({\left (31 \, d - 50 \, e + 76 \, f - 104 \, g + 112 \, h\right )} x^{2} + 3 \, {\left (31 \, d - 50 \, e + 76 \, f - 104 \, g + 112 \, h\right )} x + 62 \, d - 100 \, e + 152 \, f - 208 \, g + 224 \, h\right )} \log \left (x + 2\right ) + 4 \, {\left ({\left (7 \, d - 13 \, e + 19 \, f - 25 \, g + 31 \, h\right )} x^{2} + 3 \, {\left (7 \, d - 13 \, e + 19 \, f - 25 \, g + 31 \, h\right )} x + 14 \, d - 26 \, e + 38 \, f - 50 \, g + 62 \, h\right )} \log \left (x + 1\right ) + 4 \, {\left ({\left (d + e + f + g + h\right )} x^{2} + 3 \, {\left (d + e + f + g + h\right )} x + 2 \, d + 2 \, e + 2 \, f + 2 \, g + 2 \, h\right )} \log \left (x - 1\right ) - {\left ({\left (d + 2 \, e + 4 \, f + 8 \, g + 16 \, h\right )} x^{2} + 3 \, {\left (d + 2 \, e + 4 \, f + 8 \, g + 16 \, h\right )} x + 2 \, d + 4 \, e + 8 \, f + 16 \, g + 32 \, h\right )} \log \left (x - 2\right ) + 60 \, d - 72 \, e + 96 \, f - 144 \, g + 240 \, h}{144 \, {\left (x^{2} + 3 \, x + 2\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 3.65, size = 133, normalized size = 1.02 \begin {gather*} \frac {1}{144} \, {\left (31 \, d + 76 \, f - 104 \, g + 112 \, h - 50 \, e\right )} \log \left ({\left | x + 2 \right |}\right ) - \frac {1}{36} \, {\left (7 \, d + 19 \, f - 25 \, g + 31 \, h - 13 \, e\right )} \log \left ({\left | x + 1 \right |}\right ) - \frac {1}{36} \, {\left (d + f + g + h + e\right )} \log \left ({\left | x - 1 \right |}\right ) + \frac {1}{144} \, {\left (d + 4 \, f + 8 \, g + 16 \, h + 2 \, e\right )} \log \left ({\left | x - 2 \right |}\right ) - \frac {{\left (3 \, d + 6 \, f - 10 \, g + 18 \, h - 4 \, e\right )} x + 5 \, d + 8 \, f - 12 \, g + 20 \, h - 6 \, e}{12 \, {\left (x + 2\right )} {\left (x + 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.33, size = 133, normalized size = 1.02 \begin {gather*} \ln \left (x-2\right )\,\left (\frac {d}{144}+\frac {e}{72}+\frac {f}{36}+\frac {g}{18}+\frac {h}{9}\right )-\ln \left (x-1\right )\,\left (\frac {d}{36}+\frac {e}{36}+\frac {f}{36}+\frac {g}{36}+\frac {h}{36}\right )-\ln \left (x+1\right )\,\left (\frac {7\,d}{36}-\frac {13\,e}{36}+\frac {19\,f}{36}-\frac {25\,g}{36}+\frac {31\,h}{36}\right )-\frac {\frac {5\,d}{12}-\frac {e}{2}+\frac {2\,f}{3}-g+\frac {5\,h}{3}+x\,\left (\frac {d}{4}-\frac {e}{3}+\frac {f}{2}-\frac {5\,g}{6}+\frac {3\,h}{2}\right )}{x^2+3\,x+2}+\ln \left (x+2\right )\,\left (\frac {31\,d}{144}-\frac {25\,e}{72}+\frac {19\,f}{36}-\frac {13\,g}{18}+\frac {7\,h}{9}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________